<?php 
    $ssFilter      = $this->arrParam['ssFilter'];
    $action_link   = $this->baseUrl($this->currentController . '/filter/type/order');
    
    $lblCustomer   = $this->myLinkSort('Customer', 'c.full_name', $ssFilter, 
    		         $this->imgUrl . '/icon', $action_link);

    $lblID 	             = $this->myLinkSort('ID','o.id',$ssFilter,
    				       $this->imgUrl . '/icon',$action_link);
    
    $lblStatus	         = $this->myLinkSort('Status','o.status',$ssFilter,
    		               $this->imgUrl . '/icon',$action_link);
    
    $lblTour 	         = $this->myLinkSort('Tour','t.name',$ssFilter,
    		               $this->imgUrl . '/icon',$action_link);
    
    $lblQuantity         = $this->myLinkSort('Quantity','o.quantity_person',$ssFilter,
    		               $this->imgUrl . '/icon',$action_link);
    
    $lblTime             = $this->myLinkSort('Time Start','o.time_anticipate',$ssFilter,
    		               $this->imgUrl . '/icon',$action_link);
?>  

<form name="appForm" method="post" action="">
       <?php echo $this->render('admin-order-tour/toolbar/index.php'); ?>
       <?php echo $this->render('admin-order-tour/sublink/index.php'); ?>
                        <!-- BEGIN: CONTENT -->

                        <div id="element-box">

                            <div class="t">

                                <div class="t">

                                    <div class="t"></div>

                                </div>

                            </div>

                            <div class="m">

                                <!-- BEGIN: ELEMENT BOX -->

                               <div id="filters">
									
								</div>	



                                <!-- Area 4: In du lieu lay tu database -->

                                <table class="adminlist">

                                    <thead>

                                        <tr>

                                            <th width="43" ><input type="checkbox" name="checkbox" id="checkbox" onclick="checkedAll()"></th>

                                            <th><?php echo $lblTour; ?></th>

                                            <th width="150"><?php echo $lblCustomer; ?></th>
                                            
                                            <th width="40"><?php echo $lblQuantity; ?></th>
                                            
                                            <th width="140"><?php echo $lblTime; ?></th>
                                            
                                            <th width="40"><?php echo $lblStatus; ?></th>
                                            
                                            <th width="90">Control</th>

                                            <th width="34"><?php echo $lblID; ?></th>

                                        </tr>

                                    </thead>


                                    <?php 
                                        foreach ($this->Items as $key => $value) {
                                        	$id    	       = $value['id'];
                                        	$tour_name     = $value['name'];
                                        	$customer      = $value['full_name'];
                                        	$quantity      = $value['quantity_person'];
                                        	$status        = $value['status'];
                                        	$time          = $value['time_anticipate'];
                                    
                                        	// icon status
                                        	if($status == 1) {
                                        	    $linkstatus =  $this->baseUrl($this->currentController . '/status/type/0/id/' . $id);
                                        	    $imgAtive   =  $this->imgUrl . '/icon/active.png';
                                        	    $iconStatus  = $this->myIconButton('Active', $imgAtive, $linkstatus); 
                                        	}else {
                                        		$linkstatus =  $this->baseUrl($this->currentController . '/status/type/1/id/' . $id);
                                        		$imgAtive   =  $this->imgUrl . '/icon/inactive.png';
                                        		$iconStatus = $this->myIconButton('Active', $imgAtive, $linkstatus);
                                        	}
                                        	
                                        	// Icon Info
                                        	$linkInfo = $this->baseUrl($this->currentController . '/info/id/' . $id);
                                        	$imgInfo  = $this->imgUrl . '/icon_info.png';
                                        	$iconInfo = $this->myIconButton('View Item', $imgInfo, $linkInfo);
                                        	
                                        	// Icon Delete
                                        	$linkDelete = $this->baseUrl($this->currentController . '/delete/id/' . $id);
                                        	$imgDelete  = $this->imgUrl . '/icon_del.png';
                                        	$iconDelete = $this->myIconButton('Edit Item', $imgDelete, $linkDelete);
                                        	
                                        	// Icon
                                        	$strIconButton = $iconInfo . ' ' . $iconDelete;
                                        	
                                            // form checkbox
                                        	$cid   = $this->formCheckBox('cid[]', $value['id']);
                                            
                    
                                    ?>
                                    <tr class="even">						

                                        <td align="center"><?php echo $cid; ?></td>

                                        <td align="left"><?php echo $tour_name; ?></td>

                                        <td align="center"><?php echo $customer; ?></td>

                                        <td align="center"><?php echo $quantity; ?></td>
                                        
                                        <td align="center"><?php echo $time; ?></td>
                                        
                                        <td align="center"><?php echo $iconStatus; ?></td>
                                        
                                        <td align="center"><?php echo $strIconButton; ?> </td>

                                        <td align="center"><?php echo $id; ?></td>

                                    </tr>
									<?php } ?>
                                    <!-- BEGIN: PAGINATION (FOOT) -->

                                    <tfoot>

                                        <tr>

                                            <td colspan="9">

                                                <div class="container">

                                                    <div class="pagination">
				
                                                       <?php 
                                                           $currentUrl = $this->baseUrl($this->currentController . '/index');
                                                           echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml', array('currentUrl'=>$currentUrl));
                                                       ?>
                                                        <div class="limit"></div>

                                                    </div>

                                                </div>

                                            </td>

                                        </tr>					

                                    </tfoot>				<!-- END: PAGINATION (FOOT) -->

                                </table>

                                <!-- Area 4: In du lieu lay tu database - End -->



                                <!-- END: ELEMENT BOX -->	

                              <div class="clr"></div>

                            </div>

                            <div class="b">

                                <div class="b">

                                    <div class="b"></div>

                                </div>

                            </div>

                        </div>

                        <!-- END: 	CONTENT -->

                    </form>
